﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SIMS_GUI_Item
{
    public partial class StudentManagementAccount : Form
    {
        public StudentManagementAccount()
        {
            InitializeComponent();
        }

        public StudentManagementAccount(string UserName,string PassWord)
        {
            InitializeComponent();
            this.lbl_UserName.Text = UserName;
            this.lbl_PassWord.Text = PassWord;
        }

        /// <summary>
        /// 修改密码点击按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Modification_Click(object sender, EventArgs e)
        {
            /*
            ModificationPassWord mp = new ModificationPassWord(lbl_UserName.Text, lbl_PassWord.Text);
            mp.Show();
            mp.BackColor = Color.FromArgb(50, 69, 101);
            mp.Width = 1215;
            mp.Height = 850;
            mp.Location = new Point(209, 175);
            mp.Show();
            */
            this.pnl_StudentAccount.Controls.Clear();//清除Panel中的控件
            mp.TopLevel = false;//非最高层
            mp.Dock = DockStyle.Fill;//填满整个Panel控件
            this.pnl_StudentAccount.Controls.Add(mp);//添加子窗口
            mp.Show();//显示子窗口
        }

        private void Item_Achievement_Click(object sender, EventArgs e)
        {
            StudentManagementAchievement ac = new StudentManagementAchievement(lbl_UserName.Text);
            ac.Show();//显示子窗口
            this.Close();//关闭子窗口
        }

        ModificationPassWord mp;
        private void StudentManagementAccount_Load(object sender, EventArgs e)
        {
            mp = new ModificationPassWord(lbl_UserName.Text, lbl_PassWord.Text);//传递参数给mp对象
        }

        private void btn_Exit_Click(object sender, EventArgs e)
        {
            this.Close();//关闭子窗口
            Login lg = new Login();//返回登录页面
            lg.Show();//显示登录页面
        }
    }
}
